	/*删除弹框*/
	function deleteConfirm(table,deleteUrl){
		var selRows = $(table).datagrid("getSelections");
		if(selRows.length==0){
			$.messager.alert("提示","请选择要删除的行","warning");
			return;
		}
		$.messager.confirm("提示","确定要删除选中行的数据吗?",function(r){
			if(r){
				//发送异步请求
				//拼接条件
				var postData="";
				$.each(selRows,function(i){
					postData+="ids="+this.id;
					if(i<selRows.length-1){
						postData+="&";
					}
				})
				$.post(deleteUrl,postData,function(data){
					if(data.result==true){
						$(table).datagrid("reload");
					}
				})
			}
			
		});
		
	}
	/*添加弹框*/
	function addDialog(title,width,height,formHref,formId,addUrl,table){
		var d = $("<div></div>").appendTo("body");
		d.dialog({
			title:title,
			iconCls:"icon-add",
			width:width,
			height:height,
			modal:true,
			href:formHref,
			onClose:function(){$(this).dialog("destroy");},
			buttons:[{
				iconCls:"icon-ok",
				text:"确定",
				handler:function(){
					$(formId).form("submit",{
						url:addUrl,
						success:function(data){
							d.dialog("close");
							$(table).datagrid("reload");
						}
					})
				}
			},{
				iconCls:"icon-cancel",
				text:"取消",
				handler:function(){
					d.dialog("close");
				}
			}]
		})
	}